import request from '@/utils/request'

// 查询软件著作权列表
export function listCopyright(query) {
  return request({
    url: '/result/copyright/list',
    method: 'get',
    params: query
  })
}

// 查询软件著作权详细
export function getCopyright(id) {
  return request({
    url: '/result/copyright/' + id,
    method: 'get'
  })
}
/**
 * 根据多个id批量查询软件著作权详细
 */
export function getCopyrightByIds(ids) {
  return request({
    url: `/result/copyright/getCopyrightByIds`,
    method: 'get',
    params: { ids: ids.join(',') } // 将数组转换为逗号分隔的字符串
  });
}
/**
 * 根据id来查询软件著作信息
 */
export function getCopyRightById(id) {
  return request({
    url: '/result/copyright/' + id,
    method: 'get'
  })
}

// 新增软件著作权
export function addCopyright(data) {
  return request({
    url: '/result/copyright',
    method: 'post',
    data: data
  })
}

// 修改软件著作权
export function updateCopyright(data) {
  return request({
    url: '/result/copyright',
    method: 'put',
    data: data
  })
}

// 删除软件著作权
export function delCopyright(id) {
  return request({
    url: '/result/copyright/' + id,
    method: 'delete'
  })
}
/**
 * 批量导出软件著作权
 */
export function exportCopyright(params) {
  return request.post(`/result/copyright/export/copyright`, params, {
    responseType: 'blob'
  });
}
